/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mycompany.holdemdeckchecker;

import holdemdealer.ws.DealerEndpoint;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;

/**
 *
 * @author user
 */
public class WebServiceConnection {

    public static DealerEndpoint connectToWS() {

        try {
            URL url = new URL("http://localhost:8080/WS/dealer?wsdl");
            QName qname = new QName("http://holdem.home/wsdl", "DealerService");
            Service service = Service.create(url, qname);
            DealerEndpoint dealerEndpoint = service.getPort(DealerEndpoint.class);
            return dealerEndpoint;
        } catch (MalformedURLException ex) {
            System.out.println("Url is malformed");
            return null;
        }

    }
}
